import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";

import { matchPath } from "react-router-dom";

import * as Sentry from "@sentry/react";
import { Integrations } from "@sentry/tracing";
import { createBrowserHistory } from "history";
const history = createBrowserHistory();

const routes = [{ path: "/about" }, { path: "/user/:id" }, { path: "/" }];
// process.env.NODE_ENV === "development" &&
Sentry.init({
  dsn: "http://70205163a5d84811b72e77b01fdab232@localhost:9000/5",
  integrations: [
    new Integrations.BrowserTracing({
      routingInstrumentation: Sentry.reactRouterV5Instrumentation(
        history,
        routes,
        matchPath
      ),
    }),
  ],

  // Set tracesSampleRate to 1.0 to capture 100%
  // of transactions for performance monitoring.
  // We recommend adjusting this value in production
  tracesSampleRate: 1.0,
  logLevel: 3,
  release: "0.0.3",
});

ReactDOM.render(<App />, document.getElementById("root"));
